import { http } from "@/utils";

/**
 * 获取数据列表
 *
 * @param {Object} params 请求参数
 * @returns {*}
 */
export function getLoginInfoList(params = {}) {
  return http.post("/system/log/login/list", params);
}

/**
 * 获取数据列表
 *
 * @param {Object} params 请求参数
 * @returns {*}
 */
export function getLoginInfo(loginInfoId) {
  return http.get(`/system/log/login/detail/${loginInfoId}`);
}

/**
 * 删除数据
 *
 * @param {Number} infoId id
 * @returns Promise
 */
export function deleteLoginInfo(infoId) {
  return http.post("/system/log/login/delete", infoId);
}

/**
 * 批量删除数据
 *
 * @param {Array} infoId ids
 * @returns Promise
 */
export function deleteBatchLoginInfo(infoIds) {
  return http.post("/system/log/login/deleteBatch", infoIds);
}

export function getExportParams() {
  return http.get("/system/log/login/export/params");
}

export function exportLoginLog(params = {}) {
  return http.post("/system/log/login/export", params, {
    responseType: "blob",
  });
}
